package com.only4play.productcenter.infrastructre.converter;

import com.only4play.productcenter.api.constans.SerializeType;

import java.util.Objects;

/**
 * @author zlm
 * @date 2024/1/15
 */
public class SerializeTypeConverter {
  public SerializeType int2SerializeType(Integer code) {
      if(Objects.isNull(code)) {
        return null;
      }
      return SerializeType.of(code).orElse(null);
    }
    public Integer serializeType2Int(SerializeType serializeType) {
      return serializeType.getCode();
    }
}
